from flask import Flask, Blueprint
import sys
import  os
import json



# from  ..service.index_service_1  import  hello

from pathlib import Path
# 动态添加utils文件夹的路径
current_file_path = Path(os.path.abspath(__file__))
parent_dir = current_file_path.parent.parent
print(parent_dir)
sys.path.append(os.path.join(parent_dir, 'service'))
from  service  import  smartBadgeService


smartBadge = Blueprint("smartBadge", __name__)





@smartBadge.route("/record")
def smartBadge_record():

    result = smartBadgeService.smartBadge_record()

    print("   result   =  ")
    print(result)

    json_str = json.dumps(result, ensure_ascii=False)
    print("   json_str =  ")
    print(json_str)

    return json_str






